@include('admin.header')
<style type="text/css">
/*  .page_list {
    width: 100%;
  }*/

  .pagination {
    list-style: none;
    float: right;
  }

  .pagination li {
    float: left;
    padding-left: 5px;
    padding-right: 5px;
  }
</style>
<div class="wrap">
  <div class="margin-bottom-20">
    <!-- <a class="btn btn-primary edit"><i class="fa fa-plus"></i> 添加</a> -->
  </div>
  <form class="form-horizontal js-ajax-form" method="post" novalidate="novalidate">
    <table class="table table-hover table-bordered">
      <thead>
      <tr>
        <th width="100">ID</th>
        <th>订单编号</th>
        <th>所属用户</th>
        <th>手机号码</th>
        <th>所属直销套餐</th>
        <th>所属系统套餐</th>
        <th>订单总价格</th>
        <th>订单状态</th>
        <th>下单时间</th>
        <th>系统套餐订单编号</th>
        <th>第三方处理</th>
        <th width="120">操作</th>
      </tr>
      </thead>
      <tbody>
      @foreach($data as $order)
      <tr>
        <td>{{$order->id}}</td>
        <td>{{$order->order_no}}</td>
        <td>{{$order->nodename}}</td>
        <td>{{$order->mobileno}}</td>
        <td>{{$order->direct_name}}</td>
        <td>{{$order->product_group_name}}</td>
        <td>{{$order->amount}}</td>
        <td>已付款</td>
        <td>{{$order->create_time}}</td>
        <td>{{$order->order_no_group}}</td>
        <td style="text-align: center;">
        @if(empty($order->third_url))
          未处理
        @else
          已处理
        @endif
        </td>
        <td>
          <a class="detail" _id="{{$order->id}}" nodename="{{$order->nodename}}" direct_name="{{$order->direct_name}}" product_group_name="{{$order->product_group_name}}" mobileno="{{$order->mobileno}}" pay_detail="{{$order->pay_detail}}">详情</a>
        </td>
      </tr>
      @endforeach
      </tbody>
    </table>
  </form>
  @if (!empty($data))
    <div class="page_list">
        {{$data->links()}}
    </div>
  @endif
</div>

<script>
  $(function(){
    //添加/编辑
  	$('.detail').click(function(){
      //直销订单ID号
  		var id = $(this).attr('_id') || 0;
      //所属用户
      var nodename = $(this).attr('nodename');
      //手机号码
      var mobileno = $(this).attr('mobileno');
      //所属直销套餐
      var direct_name = $(this).attr('direct_name');
      //所属系统套餐
      var product_group_name = $(this).attr('product_group_name');
	    open_iframe_layer( '/globalexchange/direct_order_detail?id='+id+'&nodename='+nodename+'&direct_name='+direct_name+'&product_group_name='+product_group_name+'&mobileno='+mobileno);
    });
  });
</script>